require 'message_factory'
require'socket'

module PCLink
  DEST_PORT = 42591
  
  class Client
    def initialize(options)
      @options = options
      @message_factory = MessageFactory.new
    end 
    
    def send_hello
      msg = @message_factory.create_hello_message("192.168.2.2", @options[:port])
      sock = UDPSocket.open
      sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, 1)
      sent = sock.send(msg, 0, '255.255.255.255', DEST_PORT)
    end
  end
end

